
use "$P_Data/PCCount/daily_weekday_nonholiday-7to21-positive_price_only_e5.dta", clear

tostring YMD, replace
gener date = date(YMD,"YMD")
gener month = month(date)
gener year = year(date)
drop YMD
rename date YMD

drop if year<2016
drop if year>2018

merge m:1 StID using "$P_Data/GS/gas_station.dta"
drop if _merge==2
drop _merge

gener week = week(YMD)

gener weekly_date = yw(year,week)

gegen mean_PCCount = mean(PCCount), by(weekly_date StID)

fsort StID weekly_date YMD
by StID weekly_date: keep if _n==1

gener station1 = (strpos(Name,"bft-willer station 131")>0)
gener station2 = (strpos(Name,"bft-tankstelle lehmann")>0)

format weekly_date %tw 

sort StID weekly_date

tw (line mean_PCCount weekly_date if station1==1) (line mean_PCCount weekly_date if station2==1), xtitle("Week") ytitle("Mean Daily N Price Changes") legend(order (1 "Willer Station 131 in Kiel" 2 "Tankstelle Lehmann in Aalen") pos(6) col(2)) 

gr export "$P_Figures/Figure_D1.eps", replace
